<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.jxLC.Action.*"%>
<%@ page language="java" import="com.jxLC.Model.*" %>
<%@ page language="java" import="com.jxLC.Service.*" %>
<%@include file="/checkuLoginSession.jsp" %>
<%@ page import="com.jxLC.util.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
User user=(User)session.getAttribute("us");
UserService us=new UserService();
FilesService filesService=new FilesService();
FilecontentService fService=new FilecontentService();
List<Files> files=filesService.getfile();
List<Filecontent> ft=fService.getFilecontents(user.getCnum());
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>:::江西低碳-企业用户平台:::</title>
	<link href="/mycss/my.css"  rel="stylesheet" type="text/css" />
	<link href="/mycss/details.css"  rel="stylesheet" type="text/css" />
	<script type="text/javascript" charset="utf-8" src="../kindeditor/kindeditor.js"></script>
	<script type="text/javascript" src="/myjs/my.js"></script>
	<script type="text/javascript" src="/myjs/jiaoyan.js"></script>
	<style type="text/css">
	 table,td,th{ font-size:14px; border:1px solid #339966;border-collapse:collapse; }
	 th{background:#EBFCF3;}
	 #m{background-color:white}
	 #ma{height:30px; background-image:url(../my.photo/photo/h3.jpg); color:white;padding-top:5px;}
	 #mb{float: left; width:240px;height:100%; background-color: ; margin:3px;}
	 #mb2{height:30px; font-family: "正楷 "; background-color:#339966;width:220px; color:white; padding:6px;margin-top:2px;font-weight: bold; }
	 #mb3 a{ text-decoration: none; font-family: "宋 "; color:#006699;font-size:14px; font-weight: bold;}
	 #mb3 a:hover{color:green}
	 #mc{float: left;}
	 #mc1{height:10px;background-color: #339966; width:98%;padding-left:4px;margin-top:4px;overflow:hidden;}
	 #mc2{padding-left:10px;margin-top:20px;border-bottom:1px dashed green;width:98%;}
	 #mc5{margin-top:40px;}
	 table a{text-decoration: none;font-size:13px;color:blue}
	 table a:hover{ color:red} 
    </style>
    <script type="text/javascript">
        window.onload=function()
   { 
        var result ="<%=request.getAttribute("mesg")%>";
        if(result!='null'  &&  result!=undefined)
      {
             alert(result);
       }  
   }
	</script>
  </head>
  
 <body style="background-color:#EBFCF3">
    <s:include value="/admin/header.jsp"></s:include>
	<center><div id="m" >
      <s:include value="/user/userleft.jsp"></s:include>
       <div id="mc">
          <div id="mc1"></div>
          <div id="mc2">
           <h4 align="left"><img  src="/my.photo/photo/to.gif"><font style="color:black;font-family: 仿宋 ;font-weight: bold;">当前用户：</font><font style="color:blue;font-family: 仿宋 ;font-weight: bold;">企业用户</font></h4>
            <h4 align="left"><img  src="/my.photo/photo/to.gif"><font style="color:black;font-family: 仿宋 ;font-weight: bold;">当前位置：</font><font style="color:blue;font-family: 仿宋 ;font-weight: bold;">查看我的文件</font></h4>
          	 <h4 align="left"><img  src="/my.photo/photo/to.gif"><font style="color:black;font-family: 仿宋 ;font-weight: bold;">操作：</font><font style="color:blue;font-family: 仿宋 ;font-weight: bold;"><a href="upfile.jsp">增加新项目</a></font></h4>
          </div>
          <div id="mc3">
          <div id="mc5"><font style="font-size:16px; font-weight:bold">文件列表</font></div>
          <table width="700" style="margin-top:10px" >
             <tr height="30">
               <th width="45">编号</th> <th width="70">类型</th> <th>主题</th><th >日期</th><th >状态</th>  <th width="100">操作</th>
             </tr>
             <%
            int pageSize=8;             //每页显示条数
            int recordCount=ft.size();  //总记录数
            int currentPage=1;          //当前页
            String currentPageStr=request.getParameter("page");
            if(currentPageStr !=null){
            currentPage=Integer.parseInt(currentPageStr);
            }
            PageUtil pageUtil =new PageUtil(pageSize,recordCount,currentPage);
            int  j;
            j=(currentPage-1)*8+1;
            for(int i=pageUtil.getFromIndex();i<pageUtil.getToIndex();i++){
        	 Filecontent filecontent=ft.get(i);
             Files fs=filesService.getCtopic(filecontent.getCFile_id());
             %>
          <tr >
          <td height="35" align="center"><font style="font-size: 14px;"><%=j%></font></td>
          <td align="center"><font style="font-size: 13px; font-family:宋体 "><%=fs.getCFile_topic() %></font></td>
          <td align="center"><font style="font-size: 13px; font-family:宋体 "><%=filecontent.getCFC_topic() %></font></td>
          <td align="center"><font style="font-size: 13px; font-family:宋体 "><%=filecontent.getCFC_time() %></font></td>
          <td align="center"><font style="font-size: 13px; font-family:宋体 "><%=filecontent.getCFC_if() %></font></td>
          <td align="center"><%if(!"审核通过".equals(filecontent.getCFC_if())) { %><a href="seek.action?CFC_id=<%=filecontent.getCFC_id() %>" target="_self">查看编辑</a><%} %></td>
          </tr>
             <%
             j++;
              }
             %>
               <tr>
       <td colspan="6" height="40"   align="center">
           <font style="font-size: 14px;"> 记录总数<%=recordCount %>条   每页显示<%=pageSize %>条   当前页/总页数  <%=pageUtil.getCurrentPage() %>/<%=pageUtil.getPageCount() %>
           <a href="myfile.jsp?page=1">首页</a>  
           <a href="myfile.jsp?page=<%=pageUtil.getPrevPage() %>">上页 </a>|       
           <a href="myfile.jsp?page=<%=pageUtil.getNextPage() %>">下页 </a>|
           <a href="myfile.jsp?page=<%=pageUtil.getPageCount() %>">末页 </a>
              跳到<input type="text" size="3" id="newPage">页 </font>
        <input type="button"  value="GO" onclick="processGoPage()" > 
           <script type="text/javascript">
				function processGoPage() {
			    var newPage = document.getElementById("newPage").value;
	            var reg = /\d+$/;	
	            if(!newPage.match(reg))	{
				alert('页面格式不合法');
				document.getElementById("newPage").focus();
				}
				else{
				window.location.href="myfile.jsp?page="+newPage}
				}
          </script>
     </td>
  </tr>
             </table>
  
          </div>
       </div>
	</div></center>
	<s:include value="/admin/tail.jsp"></s:include>
</body>
</html>
